
#
#  Copyright (c) 2008 - 2009 NVIDIA Corporation.  All rights reserved.
#
#  NVIDIA Corporation and its licensors retain all intellectual property and proprietary
#  rights in and to this software, related documentation and any modifications thereto.
#  Any use, reproduction, disclosure or distribution of this software and related
#  documentation without an express license agreement from NVIDIA Corporation is strictly
#  prohibited.
#
#  TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
#  AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
#  INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
#  PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
#  SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
#  LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
#  BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
#  INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
#  SUCH DAMAGES
#

if(GLUT_FOUND AND OPENGL_FOUND)
  set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/jfv.cu
	PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ
	)
  include_directories(${GLUT_INCLUDE_DIR})
  add_definitions(-DGLUT_FOUND -DGLUT_NO_LIB_PRAGMA)

  # See top level CMakeLists.txt file for documentation of OPTIX_add_sample_executable.
  OPTIX_add_sample_executable( progressivePhotonMap
    ppm.cpp
    ppm.h
    select.h
    PpmObjLoader.h
    PpmObjLoader.cpp
    ppm_rtpass.cu
    ppm_ppass.cu
    ppm_gather.cu

	# add
	jfv.cu
	jfv_gpu.h
	jfv_gpu.cpp
	gpc.h
	gpc.cpp
	opengltool.cpp
	opengltool.h
	asa266.hpp
	asa266.cpp
	gamma.h
	gamma.cpp

    # These files are common among multiple samples
    helpers.h
    parallelogram.cu
    path_tracer.h
    random.h
    sphere.cu
    triangle_mesh.cu
    )

	 target_link_libraries( progressivePhotonMap
      ${CUDA_LIBRARIES}
      ${CUDA_TOOLKIT_RPATH_FLAG}
      )

else()
  # GLUT or OpenGL not found
  message("Disabling progressive_photon, which requires glut and opengl.")
endif()



